import request from "@/utils/request";
import type { CommentListParams, CommentListResponse, CommentTotal } from "@/type/CommentType";
import { ResponseType } from "@/type/ResponseType";

enum Enum {
   fetchCommentTotalAPI = "/comment/total",
   fetchCommentListAPI = "/comment/list"
}

/**
 * @description 获取商品评价总数的接口
 * */
export const fetchCommentTotalAPI = (goodsId: string) => request.get<{ total: CommentTotal }, ResponseType<{ total: CommentTotal }>>(Enum.fetchCommentTotalAPI, { params: { goodsId } });

/**
 * @description 商品评价列表的接口
 * */
export const fetchCommentListAPI = (params: CommentListParams) => request.get<{list:CommentListResponse}, ResponseType<{list:CommentListResponse}>>(Enum.fetchCommentListAPI,{params});
